import user from '@/common/user'

export default function({ req, app, store, redirect, route }) {
  if (user.isLogin(app.$cookies)) {
    // user.removeToken(app.$cookies)
    const { frontStyle } = store.state.systemStyle
    // const frontStyle = 4 //风格
    // console.log('window', window?.location)

    if(frontStyle===4) {
      // !/main4/.test(route.name) && app.router.replace('/main4')
      !/main4/.test(route.name) && redirect('/main4')
    }else{
      // !/main/.test(route.name) && app.router.replace('/main')
      !/main/.test(route.name) && redirect('/main')
    }
  }
}
